﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LogHelper
{
    public class LogInfo
    {
        public static String GetMacAdress()
        {
            System.Net.IPHostEntry myenty = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName());
            String macadress = myenty.AddressList[0].ToString();
            return "MAC地址为：" + macadress;
        }
        public static String GetHostIP()
        {

            System.Net.IPAddress[] adressList = System.Net.Dns.GetHostAddresses(System.Net.Dns.GetHostName());
            String ipAdress = adressList[0].ToString();
            for (int i = 1; i < adressList.Length; i++)
            {
                ipAdress = ipAdress + "," + adressList[i];
            }

            return ipAdress;
        }
        public static String GetTime()
        {
            return DateTime.Now.ToString();
        }

        public static String GetLogInfoo()
        {
            String logInfo = "时间：" + GetTime() + ",主机：" + GetHostIP();// +"，用户：" + GlobalValue.Context.curUser;
            return logInfo;
        }


        public static String GetLogInfo()
        {
            String logInfo = "主机：" + GetHostIP();
            return logInfo;

        }



    }

}
